/**
 * \file lib/system/hw.c
 * \author Davide Gessa
 * \date 10-16-09
 */
#include "hw.h"
#include "syscall.h"
#include <libc/ctype.h>
#include "regs.h"

void hw_handler_reg(uint8_t n, void (*func)(regs_t *r))
{
	regs_t r;
	r.eax = HW_HANDLER_REG;
	r.ebx = n;
	r.ecx = (uint32_t) func;
	syscall_call(r);
}

void hw_handler_unreg(uint8_t n)
{
	regs_t r;
	r.eax = HW_HANDLER_UNREG;
	r.ebx = n;
	syscall_call(r);	
}

void hw_debug_out(char c)
{
	regs_t r;
	r.eax = HW_DEBUGOUT;
	r.ebx = c;
	syscall_call(r);
}

void hw_shutdown()
{
	regs_t r;
	r.eax = HW_SHUTDOWN;
	syscall_call(r);
}
